/*
 * @Author: “ygnnli” “1585923072@qq.com”
 * @Date: 2024-07-31 21:26:49
 * @LastEditors: “ygnnli” “1585923072@qq.com”
 * @LastEditTime: 2024-07-31 21:49:50
 * @FilePath: /110/36/testThread.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <iostream>
#include <unistd.h>
#include <pthread.h>
#include <sys/types.h>

void* newthreadrun(void* args)
{
    while(1)
    {
        std::cout<< "I am new tread,pid: " << getpid() <<std::endl;
        sleep(1);
    }

    return nullptr;
}

int main()
{
    pthread_t tid;
    pthread_create(&tid,nullptr,newthreadrun,nullptr);

    while(1)
    {
        std::cout<< "I am main tread,pid: " << getpid() <<std::endl;
        sleep(1);
    }

    return 0;
}